//
// Created by LiuYou on 2021/8/20.
//

#ifndef HIGHPERFORMANCELINUXSERVERPROGRAMMING_LINUX2_HTTPCONNECTNEED_HPP
#define HIGHPERFORMANCELINUXSERVERPROGRAMMING_LINUX2_HTTPCONNECTNEED_HPP


/** 解析客户请求时, 主状态机所处的状态。*/
enum class CheckState {
    CHECK_STATE_REQUEST_LINE = 0,
    CHECK_STATE_HEADER,
    CHECK_STATE_CONTENT
};

/** HTTP请求方法, 但我们仅支持 GET。*/
enum class Method {
    GET = 0,
    POST,
    HEAD,
    PUT,
    DELETE,
    TRACE,
    OPTIONS,
    CONNECT,
    PATCH
};

/** 服务器处理HTTP请求的可能结果。*/
enum class HttpCode {
    NO_REQUEST,
    GET_REQUEST,
    BAD_REQUEST,
    NO_RESOURCE,
    FORBIDDEN_REQUEST,
    FILE_REQUEST,
    INTERNAL_ERROR,
    CLOSED_CONNECTION
};

enum class LineStatus {
    LINE_OK = 0,
    LINE_BAD,
    LINE_OPEN
};

#endif //HIGHPERFORMANCELINUXSERVERPROGRAMMING_LINUX2_HTTPCONNECTNEED_HPP
